#include <stdio.h>
#include "sign.h"

int
main(int argc, char *argv[])
{
	Sign_pkey pkey;
	Sign_skey skey;
	Msg msg;

	sign_keys(skey, pkey);
	msg_send_init(&msg, sizeof("Hello, world!"), "Hello, world!", 0);

	if (msg_sign(&msg, skey) < 0)
		printf("Sign err\n");

	/* if (msg_sign_open(&msg, pkey) < 0) */
	/* 	printf("Msg open error\n") */;

	if (signer_add(&msg, pkey) < 0)
		printf("Add err\n");

	if (signer_open(&msg, pkey) < 0)
		printf("Open err\n");

	printf("%s\n", msg.buf);
	msg_dispose(&msg);
	return 0;
}
/* { */
/* 	Misv_nonce nonce; */
/* 	Misv_skey client_skey; */
/* 	Misv_skey server_skey; */
/* 	Misv_skey recvr_skey; */
/* 	Misv_pkey client_pkey; */
/* 	Misv_pkey server_pkey; */
/* 	Misv_pkey recvr_pkey; */
/* 	Msg msg; */
/* 	Msg msg2; */

/* 	if (sodium_init() < 0) */
/* 		return 1; */

/* 	randombytes_buf(nonce, sizeof(nonce)); */
/* 	crypto_box_keypair(client_pkey, client_skey); */
/* 	crypto_box_keypair(server_pkey, server_skey); */
/* 	crypto_box_keypair(recvr_pkey, recvr_skey); */
/* 	msg_send_init(&msg, sizeof("Hi!\n"), "Hi\n", 0); */

/* 	if (misv_client_crypt(&msg2, &msg, nonce, client_skey, client_pkey, */
/* 			      server_pkey, recvr_pkey) < 0) */
/* 		printf("What!\n"); */

/* 	msg_dispose(&msg); */

/* 	if (misv_server_decrypt(&msg, &msg2, nonce, client_pkey, server_skey, */
/* 				server_pkey, recvr_pkey) < 0) */
/* 		printf("Oh no!\n"); */

/* 	msg_dispose(&msg2); */

/* 	misv_recvr_decrypt(&msg2, &msg, nonce, client_pkey, recvr_skey, */
/* 			   recvr_pkey); */

/* 	printf("%s", msg2.buf); */
/* 	msg_dispose(&msg); */
/* 	msg_dispose(&msg2); */
/* 	return 0; */
/* } */
